import Vue from "vue";
import VueRouter from "vue-router";

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter);

import { routes, iconRoutes } from "./routes";

let mode = process.env.NODE_ENV === "development" ? "hash" : "hash";
// let mode = process.env.NODE_ENV === "development" ? "hash" : "history";

const router = new VueRouter({
	mode,
	// base: "/behavior_web/",
	routes: routes.concat(iconRoutes)
});

export default router;
